package com.bnz.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author wangye
 * @since 2023-03-21
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("emp01")  // 选择用哪张表，因为之前表名和类名一样所以不用添加这个注解
public class Emp implements Serializable {

    private static final long serialVersionUID = 1L;

    //@TableId(value = "eid", type = IdType.AUTO)   //自动增长
    @TableId(value = "eid", type = IdType.ASSIGN_ID)    // 使用雪花算法实现创建不同的id
    private String eid;

    private String ename;

    private String bdate;

    private String sex;

    private String city;

    private Integer did;

    @TableLogic     // 默认1代表逻辑删除，0代表不删除
    private int deleted;
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime created;
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime updated;
    // 构造方法
    public Emp(String ename, String bdate, String sex, String city, Integer did) {
        this.ename = ename;
        this.bdate = bdate;
        this.sex = sex;
        this.city = city;
        this.did = did;
    }
    public Emp(String eid,String ename, String bdate, String sex, String city, Integer did) {
        this.eid = eid;
        this.ename = ename;
        this.bdate = bdate;
        this.sex = sex;
        this.city = city;
        this.did = did;
    }

}
